import com.git.groovy.service.HandlerMyTest
import com.git.groovy.service.HelloService
import com.git.groovy.service.ITest
import com.git.groovy.service.MyTestService
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value

class MyTestGroovyService2 extends MyTestService{

    @Value('${user.name}')
    private String name;

    /**
     * 此处不重写，则只能在抽象类里使用，在该类中无法使用
     * 会报：groovy.lang.MissingPropertyException: No such property
     */
    Logger log = LoggerFactory.getLogger("XXXX Pay MyTestGroovyService2");


    @Autowired
    HandlerMyTest handlerMyTest;

    @Override
    String sayHello(String str) {
        log.info("MyTestGroovyService2.sayHello:{} name:{}",str,name);
        String res = handlerMyTest.testITest(str,new ITest() {
            @Override
            String runTest() {

                return "runTest res"
            }
        });
        log.info("MyTestGroovyService2.sayHello res:{}",res)
        return "MyTestGroovyService2:"+str;
    }

}
